package com.example.demo.design.strategy_pattern;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 20:46 2020/11/18
 * @Modified By:
 */
public class Test {
    public static void main(String[] args) {
        MovieTicket ticket = new MovieTicket();
        double originalPrice = 29D;
        ticket.setPrice(originalPrice);
        ticket.setDiscount(new ChildrenDiscount());
        System.out.println(ticket.getPrice());
        System.out.println("**********************");
        ticket.setDiscount(new VipDiscount());
        System.out.println(ticket.getPrice());
        System.out.println("**********************");
        ticket.setDiscount(new StudentDiscount());
        System.out.println(ticket.getPrice());
    }
}
